<template>
  <div>
    <el-card class="box-card">
      <div slot="header" class="clearfix">
        <span>日报修改</span>
        <el-button @click="backUserList" style="float: right; padding: 3px 0" type="text">返回日报列表</el-button>
      </div>
      <div>
        <el-form ref="form" :model="form" label-width="80px">
          <el-form-item label="工作内容" prop="form.work_content">
            <el-input style="width: 300px" v-model="form.work_content"></el-input>
          </el-form-item>
          <el-form-item label="明日计划" prop="form.tomorrow_plan">
            <el-input style="width: 300px" v-model="form.tomorrow_plan"></el-input>
          </el-form-item>
          <el-form-item label="工作进度" prop="form.work_work_process">
            <el-slider
                    v-model="form.work_process"
                    :step="10">
            </el-slider>
          </el-form-item>
          <el-form-item label="问题" prop="form.problem">
            <el-input style="width: 300px" v-model="form.problem"></el-input>
          </el-form-item>
          <el-form-item label="备注" prop="form.other">
            <el-input style="width: 300px" v-model="form.other"></el-input>
          </el-form-item>
        </el-form>
        <el-button @click="submit" type="primary">提交修改</el-button>
      </div>
    </el-card>

  </div>
</template>

<script>
  import {editDaily} from "../../network/Daily";
  export default {
    name: "DailyEdit",
    data() {
      return {
        departmentIds:[],
        form: {
        }
      }
    },
    methods: {
      getDailyData() {
        this.form = this.$store.state.dailyData
        console.log(this.form)
      },

      backUserList() {
        this.$router.back(1)
      },
      submit() {
        editDaily(this.form).then(res => {
          this.$message.success('修改日报成功')
          setTimeout(() => {
            this.$router.back(1)
          }, 500)
        }, err => {
          this.$message.error('修改日报失败，请检查错误')
        })
      }
    },
    created() {
      this.getDailyData()
    }
  }
</script>

<style scoped>

</style>
